class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: B = None
        self.w: G = None
        self.x: C = None
        self.t: H = None
        self.u: A = None
        self.q: G = None
        self.r: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: F = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: B = None
        self.w: G = None
        self.x: C = None
        self.t: H = None
        self.u: A = None
        self.q: G = None
        self.r: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: F = None
        self.o: A = None
        self.txt = txt

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

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

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