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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: H = None
        self.w: H = None
        self.z: A = None
        self.x: A = None
        self.p: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: A = None
        self.t: H = None
        self.s: E = None
        self.txt = txt

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

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

l = A("l")
h = B("h")
k = C("k")
n = D("n")
g = E("g")
e = F("e")
m = G("m")
d = H("d")
b = F("b")
f = E("f")

l.t = d
h.u = l
h.z = l
h.x = l
h.r = d
h.w = d
h.p = n
k.v = h
n.t = m
n.v = h
g.u = f
g.s = n
e.w = d
e.t = d
e.p = l
e.s = g
m.v = l
m.w = l
d.y = n
b.w = d
b.t = d
b.p = l
b.s = g
f.u = g
f.s = n
assert e.p.t.y.t.v.t.y.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: H = None
        self.w: H = None
        self.z: A = None
        self.x: A = None
        self.p: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: A = None
        self.t: H = None
        self.s: E = None
        self.txt = txt

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

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

l = A("l")
h = B("h")
k = C("k")
n = D("n")
g = E("g")
e = F("e")
m = G("m")
d = H("d")
b = F("b")
f = E("f")

l.t = d
h.u = l
h.z = l
h.x = l
h.r = d
h.w = d
h.p = n
k.v = h
n.t = m
n.v = h
g.u = f
g.s = n
e.w = d
e.t = d
e.p = l
e.s = g
m.v = l
m.w = l
d.y = n
b.w = d
b.t = d
b.p = l
b.s = g
f.u = g
f.s = n
assert e.p.t.y.t.v.t.y.v.w.txt == "d"