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

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

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

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

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

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

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

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

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

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

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

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

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

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

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