class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: G = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: E = None
        self.v: F = None
        self.z: B = None
        self.u: C = None
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: B = None
        self.txt = txt

g = A("g")
h = B("h")
b = C("b")
l = D("l")
n = E("n")
d = F("d")
f = G("f")
m = B("m")
k = G("k")

g.w = f
g.t = n
h.y = b
h.q = n
b.q = f
b.o = f
b.x = k
l.x = n
l.q = n
l.v = d
l.z = h
l.u = b
l.o = k
n.t = h
n.y = d
d.s = l
f.u = b
f.s = m
m.y = b
m.q = n
k.u = b
k.s = m
assert l.v.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: G = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: E = None
        self.v: F = None
        self.z: B = None
        self.u: C = None
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: B = None
        self.txt = txt

g = A("g")
h = B("h")
b = C("b")
l = D("l")
n = E("n")
d = F("d")
f = G("f")
m = B("m")
k = G("k")

g.w = f
g.t = n
h.y = b
h.q = n
b.q = f
b.o = f
b.x = k
l.x = n
l.q = n
l.v = d
l.z = h
l.u = b
l.o = k
n.t = h
n.y = d
d.s = l
f.u = b
f.s = m
m.y = b
m.q = n
k.u = b
k.s = m
assert l.v.s.o.txt == "k"