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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: G = None
        self.u: B = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: C = None
        self.x: F = None
        self.p: C = None
        self.y: D = None
        self.w: D = None
        self.o: E = None
        self.txt = txt

c = A("c")
e = B("e")
f = C("f")
j = D("j")
n = E("n")
d = F("d")
m = G("m")
i = H("i")
g = F("g")

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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: G = None
        self.u: B = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: C = None
        self.x: F = None
        self.p: C = None
        self.y: D = None
        self.w: D = None
        self.o: E = None
        self.txt = txt

c = A("c")
e = B("e")
f = C("f")
j = D("j")
n = E("n")
d = F("d")
m = G("m")
i = H("i")
g = F("g")

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