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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: E = None
        self.z: D = None
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: B = None
        self.u: C = None
        self.y: A = None
        self.r: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: E = None
        self.v: C = None
        self.o: B = None
        self.y: C = None
        self.t: D = None
        self.txt = txt

c = A("c")
i = B("i")
h = C("h")
b = D("b")
m = E("m")
k = F("k")
j = E("j")

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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: E = None
        self.z: D = None
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: B = None
        self.u: C = None
        self.y: A = None
        self.r: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: E = None
        self.v: C = None
        self.o: B = None
        self.y: C = None
        self.t: D = None
        self.txt = txt

c = A("c")
i = B("i")
h = C("h")
b = D("b")
m = E("m")
k = F("k")
j = E("j")

c.o = b
c.z = h
c.u = k
c.v = j
c.x = j
c.p = i
i.p = h
i.y = c
i.q = c
h.w = c
h.v = j
h.z = b
h.r = k
b.w = i
b.p = i
b.u = h
b.y = c
b.r = j
m.s = j
m.z = j
m.w = k
m.p = h
k.r = j
k.q = m
k.v = h
k.y = h
k.o = i
k.t = b
j.s = m
j.z = m
j.w = k
j.p = h
assert m.w.o.p.w.z.txt == "h"