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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: F = None
        self.x: C = None
        self.w: C = None
        self.y: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: E = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: F = None
        self.x: C = None
        self.w: C = None
        self.y: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: E = None
        self.q: A = None
        self.txt = txt

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

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

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

n.t = c
n.r = l
n.o = l
n.z = l
n.x = g
n.q = k
m.x = f
m.r = f
m.q = k
m.o = k
i.p = m
i.r = c
i.x = a
i.w = a
i.y = a
e.x = m
e.p = k
e.q = l
k.z = g
k.y = c
k.w = l
k.t = e
c.o = e
c.r = e
c.t = e
c.x = a
f.p = g
f.r = c
f.x = a
f.w = a
f.y = a
a.p = m
a.r = c
a.x = f
a.w = f
a.y = i
l.t = c
l.r = n
l.o = n
l.z = n
l.x = m
l.q = k
g.x = i
g.r = i
g.q = k
g.o = k
assert c.t.p.z.x.txt == "i"