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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: G = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: G = None
        self.p: F = None
        self.w: A = None
        self.q: H = None
        self.y: H = None
        self.z: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: E = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: H = None
        self.t: E = None
        self.s: E = None
        self.w: D = None
        self.u: E = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: D = None
        self.txt = txt

l = A("l")
d = B("d")
n = C("n")
f = D("f")
a = E("a")
e = F("e")
j = G("j")
b = H("b")
h = G("h")

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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: G = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: G = None
        self.p: F = None
        self.w: A = None
        self.q: H = None
        self.y: H = None
        self.z: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: E = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: H = None
        self.t: E = None
        self.s: E = None
        self.w: D = None
        self.u: E = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: D = None
        self.txt = txt

l = A("l")
d = B("d")
n = C("n")
f = D("f")
a = E("a")
e = F("e")
j = G("j")
b = H("b")
h = G("h")

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