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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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

k = A("k")
m = B("m")
c = C("c")
l = D("l")
n = E("n")
h = F("h")

k.x = c
k.t = l
m.q = n
m.p = n
m.t = l
m.z = l
m.v = c
m.o = k
c.w = h
c.y = l
c.s = m
l.p = h
n.s = h
n.o = h
n.r = h
n.t = h
n.p = l
n.x = l
h.s = m
h.q = k
h.o = l
assert k.t.p.s.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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

k = A("k")
m = B("m")
c = C("c")
l = D("l")
n = E("n")
h = F("h")

k.x = c
k.t = l
m.q = n
m.p = n
m.t = l
m.z = l
m.v = c
m.o = k
c.w = h
c.y = l
c.s = m
l.p = h
n.s = h
n.o = h
n.r = h
n.t = h
n.p = l
n.x = l
h.s = m
h.q = k
h.o = l
assert k.t.p.s.o.t.txt == "l"