class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: D = None
        self.r: F = None
        self.x: F = None
        self.q: F = None
        self.p: E = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: A = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: F = None
        self.v: E = None
        self.y: D = None
        self.z: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: A = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: F = None
        self.v: E = None
        self.y: D = None
        self.z: C = None
        self.txt = txt

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

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