class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: C = None
        self.z: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: C = None
        self.z: F = None
        self.o: G = None
        self.r: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: D = None
        self.w: G = None
        self.z: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: C = None
        self.z: F = None
        self.o: G = None
        self.r: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: D = None
        self.w: G = None
        self.z: B = None
        self.txt = txt

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

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

c.r = m
c.o = l
c.z = l
n.x = c
l.s = c
l.p = n
g.p = l
g.w = l
g.z = k
g.r = k
g.o = e
m.w = f
m.v = k
m.s = k
m.z = c
m.y = g
k.v = m
k.o = g
k.w = e
k.z = n
e.u = l
e.y = l
f.u = l
f.y = l
assert f.y.s.r.v.v.v.v.txt == "m"