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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: E = None
        self.o: E = None
        self.v: D = None
        self.u: A = None
        self.s: D = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: D = None
        self.p: C = None
        self.z: A = None
        self.u: F = None
        self.txt = txt

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

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

j = A("j")
m = B("m")
k = C("k")
e = D("e")
c = E("c")
b = F("b")
l = G("l")

j.z = b
j.x = e
m.v = e
m.y = b
m.w = l
k.r = b
k.q = c
k.o = c
k.v = e
k.s = e
k.u = j
k.x = j
e.z = j
c.v = b
c.u = b
c.y = e
c.p = k
c.z = j
b.q = k
b.t = m
l.w = k
l.y = c
l.o = c
l.q = c
l.t = b
assert m.y.t.v.z.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: E = None
        self.o: E = None
        self.v: D = None
        self.u: A = None
        self.s: D = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: D = None
        self.p: C = None
        self.z: A = None
        self.u: F = None
        self.txt = txt

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

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

j = A("j")
m = B("m")
k = C("k")
e = D("e")
c = E("c")
b = F("b")
l = G("l")

j.z = b
j.x = e
m.v = e
m.y = b
m.w = l
k.r = b
k.q = c
k.o = c
k.v = e
k.s = e
k.u = j
k.x = j
e.z = j
c.v = b
c.u = b
c.y = e
c.p = k
c.z = j
b.q = k
b.t = m
l.w = k
l.y = c
l.o = c
l.q = c
l.t = b
assert m.y.t.v.z.z.t.txt == "m"