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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: E = None
        self.r: D = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: E = None
        self.r: D = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

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