class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: F = None
        self.v: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: E = None
        self.s: C = None
        self.o: E = None
        self.v: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: G = None
        self.p: A = None
        self.y: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: C = None
        self.txt = txt

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

a.q = g
a.v = g
a.u = l
n.x = a
n.p = k
n.o = k
n.s = d
n.v = g
d.p = n
c.v = k
k.y = a
l.x = g
l.o = f
l.p = a
l.y = i
f.t = d
f.w = a
f.q = a
f.o = k
f.x = k
f.u = l
g.y = a
g.s = i
i.p = n
m.v = k
assert a.v.s.p.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: F = None
        self.v: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: E = None
        self.s: C = None
        self.o: E = None
        self.v: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: G = None
        self.p: A = None
        self.y: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: C = None
        self.txt = txt

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

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