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

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

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

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

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

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

n = A("n")
j = B("j")
k = C("k")
i = D("i")
l = E("l")
f = F("f")
b = D("b")
a = F("a")
g = A("g")

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

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

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

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

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

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

n = A("n")
j = B("j")
k = C("k")
i = D("i")
l = E("l")
f = F("f")
b = D("b")
a = F("a")
g = A("g")

n.v = f
n.t = j
n.u = l
j.r = k
j.s = l
j.z = l
j.t = i
j.p = i
j.u = g
k.x = a
i.z = g
i.o = k
l.w = k
l.v = j
f.x = k
f.u = k
f.s = n
f.w = n
b.z = g
b.o = k
a.x = k
a.u = k
a.s = g
a.w = n
g.v = a
g.t = j
g.u = l
assert l.w.x.w.t.txt == "j"