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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: A = None
        self.y: A = None
        self.r: A = None
        self.t: B = None
        self.w: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: C = None
        self.v: F = None
        self.r: F = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: A = None
        self.y: A = None
        self.r: A = None
        self.t: B = None
        self.w: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: C = None
        self.v: F = None
        self.r: F = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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