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

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: E = None
        self.v: F = None
        self.s: B = None
        self.p: F = None
        self.o: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: E = None
        self.v: F = None
        self.s: B = None
        self.p: F = None
        self.o: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: A = None
        self.txt = txt

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

n.p = g
n.v = g
n.u = f
c.t = n
c.x = n
c.z = j
m.u = n
m.o = j
a.w = n
a.r = g
a.v = f
a.p = f
a.s = c
a.o = m
g.o = f
f.t = n
f.w = n
j.u = n
j.o = m
h.w = n
h.r = g
h.v = f
h.p = f
h.s = c
h.o = j
assert f.w.p.o.t.v.o.t.txt == "n"