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

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

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: B = None
        self.w: A = None
        self.z: A = None
        self.o: G = None
        self.x: B = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: B = None
        self.w: A = None
        self.z: A = None
        self.o: G = None
        self.x: B = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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