class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: B = None
        self.w: B = None
        self.s: F = None
        self.t: G = None
        self.v: A = None
        self.x: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

j = A("j")
i = B("i")
m = C("m")
f = D("f")
b = E("b")
k = F("k")
c = G("c")
e = B("e")

j.q = f
i.v = f
m.r = k
m.w = k
m.u = e
m.t = b
m.o = b
m.s = j
f.o = k
f.s = k
f.p = i
f.x = i
f.w = e
f.t = c
f.v = j
b.z = c
b.r = e
b.q = m
b.w = k
b.p = j
b.t = j
k.u = f
k.s = b
k.p = m
k.o = j
k.z = j
c.p = b
e.v = f
assert f.v.q.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: B = None
        self.w: B = None
        self.s: F = None
        self.t: G = None
        self.v: A = None
        self.x: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

j = A("j")
i = B("i")
m = C("m")
f = D("f")
b = E("b")
k = F("k")
c = G("c")
e = B("e")

j.q = f
i.v = f
m.r = k
m.w = k
m.u = e
m.t = b
m.o = b
m.s = j
f.o = k
f.s = k
f.p = i
f.x = i
f.w = e
f.t = c
f.v = j
b.z = c
b.r = e
b.q = m
b.w = k
b.p = j
b.t = j
k.u = f
k.s = b
k.p = m
k.o = j
k.z = j
c.p = b
e.v = f
assert f.v.q.p.v.txt == "f"