class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: D = None
        self.w: B = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: E = None
        self.t: F = None
        self.s: C = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: C = None
        self.u: C = None
        self.txt = txt

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

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

n.u = e
n.v = e
n.s = b
n.w = j
j.t = i
j.u = m
g.p = n
b.p = n
b.z = m
b.t = e
b.o = e
b.s = g
m.v = g
m.w = g
m.u = g
e.u = m
e.p = n
l.u = e
l.v = e
l.s = b
l.w = j
i.t = j
i.u = m
assert j.t.u.v.p.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: D = None
        self.w: B = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: E = None
        self.t: F = None
        self.s: C = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: C = None
        self.u: C = None
        self.txt = txt

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

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

n.u = e
n.v = e
n.s = b
n.w = j
j.t = i
j.u = m
g.p = n
b.p = n
b.z = m
b.t = e
b.o = e
b.s = g
m.v = g
m.w = g
m.u = g
e.u = m
e.p = n
l.u = e
l.v = e
l.s = b
l.w = j
i.t = j
i.u = m
assert j.t.u.v.p.u.u.u.txt == "g"