class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: F = None
        self.t: G = None
        self.w: G = None
        self.y: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: C = None
        self.y: A = None
        self.txt = txt

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

k = A("k")
g = B("g")
n = C("n")
f = D("f")
j = E("j")
h = F("h")
i = G("i")
e = D("e")
c = C("c")

k.q = h
k.p = h
k.y = h
k.t = i
k.w = i
g.q = c
n.r = i
n.w = e
n.v = e
n.q = k
f.r = k
j.o = h
j.u = h
j.t = f
j.w = f
j.p = e
j.r = k
j.z = i
h.w = n
h.p = c
h.y = k
i.q = j
i.v = c
e.r = k
c.r = i
c.w = f
c.v = f
c.q = k
assert k.w.v.r.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: F = None
        self.t: G = None
        self.w: G = None
        self.y: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: C = None
        self.y: A = None
        self.txt = txt

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

k = A("k")
g = B("g")
n = C("n")
f = D("f")
j = E("j")
h = F("h")
i = G("i")
e = D("e")
c = C("c")

k.q = h
k.p = h
k.y = h
k.t = i
k.w = i
g.q = c
n.r = i
n.w = e
n.v = e
n.q = k
f.r = k
j.o = h
j.u = h
j.t = f
j.w = f
j.p = e
j.r = k
j.z = i
h.w = n
h.p = c
h.y = k
i.q = j
i.v = c
e.r = k
c.r = i
c.w = f
c.v = f
c.q = k
assert k.w.v.r.v.q.txt == "k"