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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: F = None
        self.s: A = None
        self.u: D = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: F = None
        self.s: A = None
        self.u: D = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

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