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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: F = None
        self.z: F = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: A = None
        self.r: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: C = None
        self.q: F = None
        self.x: C = None
        self.u: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: F = None
        self.z: F = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: A = None
        self.r: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: C = None
        self.q: F = None
        self.x: C = None
        self.u: B = None
        self.txt = txt

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

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