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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: A = None
        self.v: I = None
        self.q: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: A = None
        self.w: I = None
        self.r: A = None
        self.u: I = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: D = None
        self.y: B = None
        self.t: I = None
        self.s: F = None
        self.v: I = None
        self.x: C = None
        self.w: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: C = None
        self.o: F = None
        self.s: A = None
        self.x: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: A = None
        self.v: I = None
        self.q: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: A = None
        self.w: I = None
        self.r: A = None
        self.u: I = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: D = None
        self.y: B = None
        self.t: I = None
        self.s: F = None
        self.v: I = None
        self.x: C = None
        self.w: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: C = None
        self.o: F = None
        self.s: A = None
        self.x: E = None
        self.txt = txt

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

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