class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: B = None
        self.u: F = None
        self.z: F = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: A = None
        self.q: G = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: F = None
        self.z: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: C = None
        self.r: C = None
        self.q: A = None
        self.v: E = None
        self.o: C = None
        self.txt = txt

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

c.r = k
c.x = k
c.q = k
c.u = j
c.z = j
k.y = j
k.t = c
a.w = j
a.u = c
a.q = e
a.t = k
b.y = g
b.v = j
b.z = k
g.o = k
g.q = b
g.r = j
j.o = k
e.y = c
e.q = c
e.w = a
e.r = a
e.o = a
e.v = g
d.o = k
d.q = b
d.r = j
assert c.u.o.y.o.y.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: B = None
        self.u: F = None
        self.z: F = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: A = None
        self.q: G = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: F = None
        self.z: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: C = None
        self.r: C = None
        self.q: A = None
        self.v: E = None
        self.o: C = None
        self.txt = txt

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

c.r = k
c.x = k
c.q = k
c.u = j
c.z = j
k.y = j
k.t = c
a.w = j
a.u = c
a.q = e
a.t = k
b.y = g
b.v = j
b.z = k
g.o = k
g.q = b
g.r = j
j.o = k
e.y = c
e.q = c
e.w = a
e.r = a
e.o = a
e.v = g
d.o = k
d.q = b
d.r = j
assert c.u.o.y.o.y.o.t.txt == "c"