class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: D = None
        self.p: C = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

n.y = b
n.x = c
n.p = d
n.w = g
b.x = g
b.t = d
b.r = d
b.u = d
b.p = l
b.q = l
b.o = c
d.o = a
c.v = a
c.y = j
c.x = n
c.t = b
l.z = b
l.v = j
g.z = l
g.y = j
a.p = d
a.r = c
a.w = n
a.t = j
a.y = j
a.v = l
j.q = n
j.u = n
j.t = c
j.p = c
j.w = d
assert b.x.z.v.w.o.r.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: D = None
        self.p: C = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

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