class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: C = None
        self.w: E = None
        self.t: C = None
        self.s: B = None
        self.txt = txt

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

g = A("g")
d = B("d")
a = C("a")
c = D("c")
f = E("f")
m = F("m")
n = E("n")
e = B("e")

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: C = None
        self.w: E = None
        self.t: C = None
        self.s: B = None
        self.txt = txt

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

g = A("g")
d = B("d")
a = C("a")
c = D("c")
f = E("f")
m = F("m")
n = E("n")
e = B("e")

g.v = n
d.t = m
d.s = a
d.v = c
d.o = c
a.r = g
a.p = c
c.t = g
c.x = f
f.o = a
f.y = a
f.t = a
f.w = n
f.s = e
m.x = a
m.s = c
m.u = d
n.o = a
n.y = a
n.t = a
n.w = f
n.s = e
e.t = m
e.s = a
e.v = c
e.o = c
assert f.t.r.v.t.r.v.txt == "n"