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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: D = None
        self.t: B = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: D = None
        self.t: B = None
        self.s: F = None
        self.txt = txt

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

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

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

l.o = g
l.w = n
k.u = a
k.y = h
k.o = h
m.w = c
c.s = l
a.q = k
a.t = k
a.z = g
a.s = n
n.x = a
n.z = a
n.r = m
n.u = g
n.y = l
h.s = k
g.s = l
b.s = l
assert l.o.s.w.u.s.o.s.w.txt == "n"