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

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

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: B = None
        self.z: F = None
        self.x: E = None
        self.r: E = None
        self.o: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: B = None
        self.z: F = None
        self.x: E = None
        self.r: E = None
        self.o: B = None
        self.txt = txt

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

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