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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: C = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: B = None
        self.p: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: B = None
        self.p: C = None
        self.x: B = None
        self.txt = txt

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

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

l.y = g
l.z = g
l.w = m
l.q = m
l.u = j
l.o = j
k.x = j
k.z = j
k.u = j
j.w = c
j.y = k
c.u = g
c.p = g
c.z = k
m.x = l
m.z = l
m.t = j
m.o = j
m.y = f
m.q = g
g.o = c
g.v = k
g.x = k
g.p = j
f.t = j
f.q = j
f.u = k
assert k.u.w.p.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: E = None
        self.z: F = None
        self.u: C = None
        self.q: E = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: C = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: B = None
        self.p: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: B = None
        self.p: C = None
        self.x: B = None
        self.txt = txt

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

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

l.y = g
l.z = g
l.w = m
l.q = m
l.u = j
l.o = j
k.x = j
k.z = j
k.u = j
j.w = c
j.y = k
c.u = g
c.p = g
c.z = k
m.x = l
m.z = l
m.t = j
m.o = j
m.y = f
m.q = g
g.o = c
g.v = k
g.x = k
g.p = j
f.t = j
f.q = j
f.u = k
assert k.u.w.p.txt == "g"