class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: E = None
        self.v: G = None
        self.u: C = None
        self.r: E = None
        self.y: G = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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