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

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

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

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

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

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

k = A("k")
b = B("b")
m = C("m")
j = D("j")
d = E("d")
a = F("a")
h = E("h")

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

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

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

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

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

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

k = A("k")
b = B("b")
m = C("m")
j = D("j")
d = E("d")
a = F("a")
h = E("h")

k.y = m
k.r = b
k.t = d
b.v = h
b.y = h
b.w = k
m.y = b
m.o = b
m.t = k
m.v = a
m.w = j
j.p = a
j.w = a
j.z = k
j.q = k
j.v = h
d.z = j
d.v = m
d.w = b
d.q = a
a.u = m
a.o = j
h.z = j
h.v = m
h.w = b
h.q = a
assert h.z.p.o.z.y.txt == "m"