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

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

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

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

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

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

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

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

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

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

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

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

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

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

l.p = b
l.x = j
l.y = k
h.x = j
h.r = e
h.y = e
h.t = c
h.z = l
h.v = l
j.u = e
j.r = k
b.x = j
b.u = k
b.w = c
b.y = l
k.w = h
c.u = l
c.p = j
e.w = h
i.p = b
i.x = j
i.y = k
assert h.t.p.r.w.x.r.w.txt == "h"