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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: C = None
        self.w: H = None
        self.s: C = None
        self.x: H = None
        self.txt = txt

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: C = None
        self.w: H = None
        self.s: C = None
        self.x: H = None
        self.txt = txt

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

n.p = a
n.q = m
i.x = b
i.r = e
d.v = a
d.r = f
d.u = n
j.t = m
f.x = d
a.z = l
a.y = e
e.p = b
e.v = d
l.p = e
l.o = d
l.s = d
l.w = m
l.x = m
m.p = e
m.o = d
m.s = d
m.w = l
m.x = l
b.x = i
b.r = e
assert b.x.r.v.u.q.o.v.txt == "a"