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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: B = None
        self.y: F = None
        self.t: F = None
        self.txt = txt

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

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

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

g = A("g")
d = B("d")
n = C("n")
h = D("h")
a = E("a")
b = F("b")
j = F("j")
c = D("c")
m = F("m")
f = B("f")

g.z = a
g.s = a
d.s = b
d.z = h
d.r = j
d.o = n
d.p = g
n.u = m
n.t = m
n.r = f
n.y = j
h.u = f
h.o = c
h.q = c
h.z = a
a.r = m
a.o = h
a.s = f
b.r = h
b.o = h
b.z = c
b.x = c
b.t = d
j.r = h
j.z = h
j.x = h
j.o = c
j.t = d
c.u = f
c.o = h
c.q = h
c.z = a
m.r = c
m.o = c
m.z = c
m.x = c
m.t = f
f.s = j
f.r = j
f.z = c
f.o = n
f.p = g
assert m.x.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: B = None
        self.y: F = None
        self.t: F = None
        self.txt = txt

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

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

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

g = A("g")
d = B("d")
n = C("n")
h = D("h")
a = E("a")
b = F("b")
j = F("j")
c = D("c")
m = F("m")
f = B("f")

g.z = a
g.s = a
d.s = b
d.z = h
d.r = j
d.o = n
d.p = g
n.u = m
n.t = m
n.r = f
n.y = j
h.u = f
h.o = c
h.q = c
h.z = a
a.r = m
a.o = h
a.s = f
b.r = h
b.o = h
b.z = c
b.x = c
b.t = d
j.r = h
j.z = h
j.x = h
j.o = c
j.t = d
c.u = f
c.o = h
c.q = h
c.z = a
m.r = c
m.o = c
m.z = c
m.x = c
m.t = f
f.s = j
f.r = j
f.z = c
f.o = n
f.p = g
assert m.x.u.p.txt == "g"