class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: F = None
        self.r: B = None
        self.q: F = None
        self.s: E = None
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: D = None
        self.t: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: C = None
        self.z: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: D = None
        self.t: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: C = None
        self.z: F = None
        self.txt = txt

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

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

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