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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: A = None
        self.t: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: E = None
        self.r: B = None
        self.x: A = None
        self.s: C = None
        self.z: E = None
        self.t: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: A = None
        self.t: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: E = None
        self.r: B = None
        self.x: A = None
        self.s: C = None
        self.z: E = None
        self.t: B = None
        self.txt = txt

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

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