class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: D = None
        self.s: H = None
        self.z: C = None
        self.r: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: F = None
        self.p: B = None
        self.t: F = None
        self.r: D = None
        self.x: B = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: G = None
        self.p: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: C = None
        self.o: G = None
        self.q: B = None
        self.y: B = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: G = None
        self.o: C = None
        self.p: A = None
        self.v: F = None
        self.z: G = None
        self.q: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: F = None
        self.p: B = None
        self.t: F = None
        self.r: D = None
        self.x: B = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: G = None
        self.p: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: C = None
        self.o: G = None
        self.q: B = None
        self.y: B = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: G = None
        self.o: C = None
        self.p: A = None
        self.v: F = None
        self.z: G = None
        self.q: C = None
        self.txt = txt

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

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