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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: A = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: D = None
        self.z: G = None
        self.x: D = None
        self.p: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: A = None
        self.u: G = None
        self.y: A = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: A = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: D = None
        self.z: G = None
        self.x: D = None
        self.p: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: A = None
        self.u: G = None
        self.y: A = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: G = None
        self.txt = txt

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

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

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

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