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

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

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: F = None
        self.q: C = None
        self.w: B = None
        self.txt = txt

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

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

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

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

i.x = f
l.t = g
l.r = f
l.y = e
m.v = g
m.t = l
m.s = n
g.v = e
g.p = e
g.q = m
g.w = l
b.o = g
e.q = b
e.s = m
f.u = m
f.p = i
n.v = g
n.t = l
n.s = m
assert e.q.o.v.q.o.p.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: F = None
        self.q: C = None
        self.w: B = None
        self.txt = txt

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

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

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

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

i.x = f
l.t = g
l.r = f
l.y = e
m.v = g
m.t = l
m.s = n
g.v = e
g.p = e
g.q = m
g.w = l
b.o = g
e.q = b
e.s = m
f.u = m
f.p = i
n.v = g
n.t = l
n.s = m
assert e.q.o.v.q.o.p.s.s.txt == "n"