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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: G = None
        self.s: A = None
        self.p: B = None
        self.o: F = None
        self.x: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: A = None
        self.z: B = None
        self.w: D = None
        self.u: B = None
        self.p: E = None
        self.txt = txt

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

i = A("i")
j = B("j")
c = C("c")
l = D("l")
d = E("d")
m = F("m")
b = G("b")
f = B("f")

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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: G = None
        self.s: A = None
        self.p: B = None
        self.o: F = None
        self.x: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: A = None
        self.z: B = None
        self.w: D = None
        self.u: B = None
        self.p: E = None
        self.txt = txt

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

i = A("i")
j = B("j")
c = C("c")
l = D("l")
d = E("d")
m = F("m")
b = G("b")
f = B("f")

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