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

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

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

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

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

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

h = A("h")
c = B("c")
a = C("a")
k = D("k")
e = E("e")
f = F("f")
b = B("b")
m = F("m")

h.p = c
h.z = f
h.y = a
c.v = b
c.z = b
c.t = f
c.r = a
c.o = h
c.u = k
a.w = m
k.y = e
k.z = f
e.s = h
e.v = c
f.t = a
f.p = a
f.x = k
f.o = k
f.u = b
f.s = e
b.v = c
b.z = c
b.t = f
b.r = a
b.o = h
b.u = k
m.t = a
m.p = a
m.x = k
m.o = k
m.u = c
m.s = e
assert m.p.w.s.s.y.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: F = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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

h = A("h")
c = B("c")
a = C("a")
k = D("k")
e = E("e")
f = F("f")
b = B("b")
m = F("m")

h.p = c
h.z = f
h.y = a
c.v = b
c.z = b
c.t = f
c.r = a
c.o = h
c.u = k
a.w = m
k.y = e
k.z = f
e.s = h
e.v = c
f.t = a
f.p = a
f.x = k
f.o = k
f.u = b
f.s = e
b.v = c
b.z = c
b.t = f
b.r = a
b.o = h
b.u = k
m.t = a
m.p = a
m.x = k
m.o = k
m.u = c
m.s = e
assert m.p.w.s.s.y.w.txt == "m"