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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: A = None
        self.x: B = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: A = None
        self.x: B = None
        self.z: A = None
        self.txt = txt

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

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

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

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