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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: E = None
        self.t: C = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: D = None
        self.v: D = None
        self.p: G = None
        self.q: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: C = None
        self.q: B = None
        self.v: F = None
        self.z: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: E = None
        self.t: C = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: D = None
        self.v: D = None
        self.p: G = None
        self.q: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: C = None
        self.q: B = None
        self.v: F = None
        self.z: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

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