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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

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

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

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

l.r = f
l.x = b
l.q = n
l.u = m
f.x = n
m.y = f
n.o = l
i.z = j
i.p = m
i.x = m
i.v = m
i.q = f
i.y = n
c.x = b
c.q = d
c.r = i
a.z = f
a.u = n
a.p = m
b.o = f
b.z = a
j.z = i
j.p = m
j.x = m
j.v = m
j.q = f
j.y = n
d.x = b
d.q = c
d.r = i
assert d.r.q.x.o.q.o.x.o.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: H = None
        self.q: D = None
        self.u: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

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

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

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

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