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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: A = None
        self.q: B = None
        self.o: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: C = None
        self.y: C = None
        self.r: D = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: A = None
        self.q: B = None
        self.o: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: C = None
        self.y: C = None
        self.r: D = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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