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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: I = None
        self.o: C = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: E = None
        self.t: F = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: B = None
        self.z: G = None
        self.r: I = None
        self.u: I = None
        self.t: A = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: H = None
        self.w: G = None
        self.v: B = None
        self.t: E = None
        self.r: H = None
        self.q: E = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: I = None
        self.r: C = None
        self.q: I = None
        self.w: B = None
        self.o: F = None
        self.y: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: C = None
        self.t: E = None
        self.r: G = None
        self.txt = txt

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

a = A("a")
k = B("k")
j = C("j")
f = D("f")
l = E("l")
i = F("i")
c = G("c")
b = H("b")
m = I("m")
g = B("g")

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: I = None
        self.o: C = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: E = None
        self.t: F = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: B = None
        self.z: G = None
        self.r: I = None
        self.u: I = None
        self.t: A = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: H = None
        self.w: G = None
        self.v: B = None
        self.t: E = None
        self.r: H = None
        self.q: E = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: I = None
        self.r: C = None
        self.q: I = None
        self.w: B = None
        self.o: F = None
        self.y: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: C = None
        self.t: E = None
        self.r: G = None
        self.txt = txt

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

a = A("a")
k = B("k")
j = C("j")
f = D("f")
l = E("l")
i = F("i")
c = G("c")
b = H("b")
m = I("m")
g = B("g")

a.q = i
a.p = c
k.r = c
k.x = m
k.o = j
k.z = j
j.z = i
j.t = i
j.u = l
j.v = f
f.o = a
f.t = a
f.y = g
f.w = g
f.z = c
f.r = m
f.u = m
l.x = f
l.r = g
i.p = a
i.u = b
i.r = b
i.w = c
i.v = k
i.t = l
i.q = l
i.y = l
c.z = m
c.q = m
c.r = j
c.w = k
c.o = i
c.y = l
b.o = l
b.t = l
b.x = j
b.r = c
m.p = c
g.r = c
g.x = m
g.o = j
g.z = j
assert k.r.r.v.r.p.z.p.w.r.r.txt == "j"