class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: E = None
        self.w: D = None
        self.o: D = None
        self.v: G = None
        self.u: E = None
        self.y: D = None
        self.p: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: D = None
        self.w: E = None
        self.u: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: H = None
        self.p: H = None
        self.s: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: D = None
        self.w: E = None
        self.u: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: H = None
        self.p: H = None
        self.s: E = None
        self.txt = txt

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

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

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