class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: G = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: G = None
        self.y: B = None
        self.x: E = None
        self.w: B = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: C = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

b = A("b")
e = B("e")
g = C("g")
a = D("a")
k = E("k")
d = F("d")
m = G("m")
n = G("n")

b.x = d
b.w = n
b.s = a
e.q = a
g.u = e
g.y = e
g.w = e
g.p = e
g.s = n
g.x = k
a.o = k
a.w = k
a.r = g
k.s = n
k.o = b
d.r = b
m.v = b
n.v = b
assert b.s.r.s.v.x.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: G = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: G = None
        self.y: B = None
        self.x: E = None
        self.w: B = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: C = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

b = A("b")
e = B("e")
g = C("g")
a = D("a")
k = E("k")
d = F("d")
m = G("m")
n = G("n")

b.x = d
b.w = n
b.s = a
e.q = a
g.u = e
g.y = e
g.w = e
g.p = e
g.s = n
g.x = k
a.o = k
a.w = k
a.r = g
k.s = n
k.o = b
d.r = b
m.v = b
n.v = b
assert b.s.r.s.v.x.r.x.txt == "d"