class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

j = A("j")
d = B("d")
a = C("a")
b = D("b")
k = E("k")
c = E("c")
f = C("f")
g = A("g")
n = E("n")
h = A("h")

j.u = b
d.t = b
a.u = h
a.x = h
a.y = h
a.z = f
a.v = d
b.x = d
k.z = a
k.r = f
k.w = b
c.z = f
c.r = f
c.w = b
f.u = g
f.x = j
f.z = a
f.y = h
f.v = d
g.u = b
n.z = a
n.r = f
n.w = b
h.u = b
assert j.u.x.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

j = A("j")
d = B("d")
a = C("a")
b = D("b")
k = E("k")
c = E("c")
f = C("f")
g = A("g")
n = E("n")
h = A("h")

j.u = b
d.t = b
a.u = h
a.x = h
a.y = h
a.z = f
a.v = d
b.x = d
k.z = a
k.r = f
k.w = b
c.z = f
c.r = f
c.w = b
f.u = g
f.x = j
f.z = a
f.y = h
f.v = d
g.u = b
n.z = a
n.r = f
n.w = b
h.u = b
assert j.u.x.t.x.txt == "d"