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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: C = None
        self.t: C = None
        self.q: F = None
        self.w: G = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

d.o = b
b.y = c
b.q = c
b.o = f
b.s = f
b.r = n
b.x = d
k.v = m
m.o = k
m.s = b
m.w = n
f.r = m
f.w = n
c.s = m
c.o = k
c.t = k
c.q = l
c.w = n
c.u = n
n.o = k
l.s = m
l.o = k
l.t = k
l.q = c
l.w = n
l.u = n
assert c.w.o.v.w.o.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: C = None
        self.t: C = None
        self.q: F = None
        self.w: G = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

d.o = b
b.y = c
b.q = c
b.o = f
b.s = f
b.r = n
b.x = d
k.v = m
m.o = k
m.s = b
m.w = n
f.r = m
f.w = n
c.s = m
c.o = k
c.t = k
c.q = l
c.w = n
c.u = n
n.o = k
l.s = m
l.o = k
l.t = k
l.q = c
l.w = n
l.u = n
assert c.w.o.v.w.o.v.w.txt == "n"