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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: C = None
        self.z: F = None
        self.x: C = None
        self.s: F = None
        self.o: G = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: F = None
        self.u: G = None
        self.z: G = None
        self.t: B = None
        self.p: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: A = None
        self.s: A = None
        self.t: D = None
        self.txt = txt

a = A("a")
k = B("k")
n = C("n")
e = D("e")
c = E("c")
m = F("m")
b = G("b")
f = E("f")

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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: C = None
        self.z: F = None
        self.x: C = None
        self.s: F = None
        self.o: G = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: F = None
        self.u: G = None
        self.z: G = None
        self.t: B = None
        self.p: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: A = None
        self.s: A = None
        self.t: D = None
        self.txt = txt

a = A("a")
k = B("k")
n = C("n")
e = D("e")
c = E("c")
m = F("m")
b = G("b")
f = E("f")

a.o = f
a.u = m
k.v = b
k.o = b
k.r = n
k.x = n
k.z = m
k.s = m
k.w = a
n.s = m
n.y = m
n.u = b
n.z = b
n.t = k
n.p = k
e.o = a
c.q = k
c.y = b
m.r = e
b.z = c
b.y = a
b.s = a
b.t = e
f.q = k
f.y = b
assert k.w.u.r.o.u.r.txt == "e"