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

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

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

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

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

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

m = A("m")
n = B("n")
a = C("a")
k = D("k")
j = E("j")
h = F("h")
d = B("d")
f = F("f")

m.t = j
n.x = h
n.p = f
n.u = k
a.q = k
k.t = h
k.p = h
k.u = a
k.z = a
j.y = n
j.t = f
j.r = d
j.z = h
h.r = j
h.p = d
h.v = a
h.y = n
d.x = f
d.p = h
d.u = k
f.r = j
f.p = n
f.y = n
f.v = a
assert d.u.p.y.x.v.q.p.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

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

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

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

m = A("m")
n = B("n")
a = C("a")
k = D("k")
j = E("j")
h = F("h")
d = B("d")
f = F("f")

m.t = j
n.x = h
n.p = f
n.u = k
a.q = k
k.t = h
k.p = h
k.u = a
k.z = a
j.y = n
j.t = f
j.r = d
j.z = h
h.r = j
h.p = d
h.v = a
h.y = n
d.x = f
d.p = h
d.u = k
f.r = j
f.p = n
f.y = n
f.v = a
assert d.u.p.y.x.v.q.p.txt == "h"