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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: A = None
        self.x: F = None
        self.y: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: G = None
        self.y: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: B = None
        self.z: F = None
        self.t: H = None
        self.y: B = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: C = None
        self.t: G = None
        self.v: A = None
        self.y: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: A = None
        self.x: F = None
        self.y: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: G = None
        self.y: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: B = None
        self.z: F = None
        self.t: H = None
        self.y: B = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: C = None
        self.t: G = None
        self.v: A = None
        self.y: A = None
        self.txt = txt

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

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