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

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: A = None
        self.p: F = None
        self.r: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: A = None
        self.z: B = None
        self.r: D = None
        self.v: H = None
        self.t: H = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: E = None
        self.p: E = None
        self.txt = txt

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

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

c.p = b
c.r = j
k.u = i
i.v = f
f.u = c
f.z = c
f.p = l
f.r = a
j.v = f
l.s = c
l.p = m
l.z = k
l.r = f
l.v = b
l.t = b
l.u = b
a.o = f
a.q = j
a.p = j
b.o = m
b.t = i
b.w = l
m.p = b
m.r = j
d.u = i
assert l.p.p.w.r.r.q.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: A = None
        self.p: F = None
        self.r: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: A = None
        self.z: B = None
        self.r: D = None
        self.v: H = None
        self.t: H = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: E = None
        self.p: E = None
        self.txt = txt

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

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

c.p = b
c.r = j
k.u = i
i.v = f
f.u = c
f.z = c
f.p = l
f.r = a
j.v = f
l.s = c
l.p = m
l.z = k
l.r = f
l.v = b
l.t = b
l.u = b
a.o = f
a.q = j
a.p = j
b.o = m
b.t = i
b.w = l
m.p = b
m.r = j
d.u = i
assert l.p.p.w.r.r.q.v.r.txt == "a"