class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: C = None
        self.u: F = None
        self.t: E = None
        self.w: B = None
        self.x: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: B = None
        self.y: G = None
        self.x: G = None
        self.z: C = None
        self.t: C = None
        self.s: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

k.p = l
k.w = l
k.x = l
k.v = c
k.u = e
k.t = d
l.q = j
l.y = j
l.u = e
c.y = d
j.v = c
j.z = c
j.t = c
j.p = l
j.s = l
j.y = n
j.x = h
d.u = c
d.r = l
e.p = f
e.r = d
h.r = l
n.r = l
b.r = l
f.p = l
f.w = l
f.x = l
f.v = c
f.u = e
f.t = d
assert h.r.u.p.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: C = None
        self.u: F = None
        self.t: E = None
        self.w: B = None
        self.x: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: B = None
        self.y: G = None
        self.x: G = None
        self.z: C = None
        self.t: C = None
        self.s: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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