class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: A = None
        self.u: E = None
        self.y: F = None
        self.w: A = None
        self.txt = txt

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

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

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

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

h = A("h")
d = B("d")
k = C("k")
m = D("m")
g = E("g")
c = F("c")
l = C("l")
a = A("a")
e = F("e")

h.u = g
h.t = d
d.v = c
d.y = c
d.z = a
d.u = g
d.w = h
k.p = c
k.w = g
m.y = l
g.s = c
g.t = k
g.p = d
c.q = a
c.z = d
c.w = g
c.y = g
c.t = k
c.p = h
l.p = c
l.w = g
a.u = g
a.t = d
e.q = a
e.p = a
e.z = d
e.w = g
e.y = g
e.t = k
assert h.t.u.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: A = None
        self.u: E = None
        self.y: F = None
        self.w: A = None
        self.txt = txt

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

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

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

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

h = A("h")
d = B("d")
k = C("k")
m = D("m")
g = E("g")
c = F("c")
l = C("l")
a = A("a")
e = F("e")

h.u = g
h.t = d
d.v = c
d.y = c
d.z = a
d.u = g
d.w = h
k.p = c
k.w = g
m.y = l
g.s = c
g.t = k
g.p = d
c.q = a
c.z = d
c.w = g
c.y = g
c.t = k
c.p = h
l.p = c
l.w = g
a.u = g
a.t = d
e.q = a
e.p = a
e.z = d
e.w = g
e.y = g
e.t = k
assert h.t.u.p.w.txt == "h"