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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: F = None
        self.t: E = None
        self.o: A = None
        self.x: F = None
        self.p: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: F = None
        self.z: D = None
        self.q: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: F = None
        self.t: E = None
        self.o: A = None
        self.x: F = None
        self.p: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: F = None
        self.z: D = None
        self.q: E = None
        self.txt = txt

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

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