class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: C = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

h = A("h")
c = B("c")
n = C("n")
k = D("k")
d = E("d")
j = F("j")
i = E("i")
e = E("e")

h.u = e
h.r = n
h.x = d
c.p = j
c.v = j
n.y = k
n.u = k
n.q = c
n.w = j
k.o = n
k.r = j
k.v = c
d.o = j
j.t = k
i.o = j
e.o = j
assert h.x.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: C = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

h = A("h")
c = B("c")
n = C("n")
k = D("k")
d = E("d")
j = F("j")
i = E("i")
e = E("e")

h.u = e
h.r = n
h.x = d
c.p = j
c.v = j
n.y = k
n.u = k
n.q = c
n.w = j
k.o = n
k.r = j
k.v = c
d.o = j
j.t = k
i.o = j
e.o = j
assert h.x.o.t.txt == "k"