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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: B = None
        self.q: B = None
        self.v: B = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: E = None
        self.w: B = None
        self.t: B = None
        self.txt = txt

m = A("m")
f = B("f")
l = C("l")
i = D("i")
g = E("g")
b = F("b")
a = F("a")
e = E("e")

m.z = a
m.w = e
m.x = l
m.y = l
m.u = l
m.v = f
f.z = b
f.o = i
f.u = m
l.w = a
l.u = g
i.o = m
i.t = g
i.x = l
g.u = i
g.w = f
g.q = f
g.v = f
g.x = l
b.x = a
b.r = e
b.w = f
b.t = f
a.x = b
a.r = e
a.w = f
a.t = f
e.u = i
e.w = f
e.q = f
e.v = f
e.x = l
assert g.x.u.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: E = None
        self.x: C = None
        self.v: B = None
        self.y: C = None
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: B = None
        self.q: B = None
        self.v: B = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: E = None
        self.w: B = None
        self.t: B = None
        self.txt = txt

m = A("m")
f = B("f")
l = C("l")
i = D("i")
g = E("g")
b = F("b")
a = F("a")
e = E("e")

m.z = a
m.w = e
m.x = l
m.y = l
m.u = l
m.v = f
f.z = b
f.o = i
f.u = m
l.w = a
l.u = g
i.o = m
i.t = g
i.x = l
g.u = i
g.w = f
g.q = f
g.v = f
g.x = l
b.x = a
b.r = e
b.w = f
b.t = f
a.x = b
a.r = e
a.w = f
a.t = f
e.u = i
e.w = f
e.q = f
e.v = f
e.x = l
assert g.x.u.x.u.txt == "g"