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

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

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

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

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

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

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

a.q = g
a.v = h
a.o = b
l.x = h
b.v = h
b.s = h
g.u = h
j.t = b
j.x = l
j.r = k
h.u = g
h.y = g
h.x = a
m.t = b
m.x = l
m.r = k
k.t = b
k.x = l
k.r = j
assert b.v.x.o.s.u.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: F = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

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

a.q = g
a.v = h
a.o = b
l.x = h
b.v = h
b.s = h
g.u = h
j.t = b
j.x = l
j.r = k
h.u = g
h.y = g
h.x = a
m.t = b
m.x = l
m.r = k
k.t = b
k.x = l
k.r = j
assert b.v.x.o.s.u.u.u.u.txt == "h"