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

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: A = None
        self.w: C = None
        self.v: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: C = None
        self.t: B = None
        self.s: B = None
        self.y: C = None
        self.x: A = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: A = None
        self.w: C = None
        self.v: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: C = None
        self.t: B = None
        self.s: B = None
        self.y: C = None
        self.x: A = None
        self.u: C = None
        self.txt = txt

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

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

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