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

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: G = None
        self.v: D = None
        self.r: D = None
        self.s: H = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.y: C = None
        self.t: A = None
        self.z: A = None
        self.u: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

d = A("d")
m = B("m")
n = C("n")
g = D("g")
b = E("b")
l = F("l")
a = G("a")
f = H("f")
j = D("j")
i = E("i")

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

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: G = None
        self.v: D = None
        self.r: D = None
        self.s: H = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.y: C = None
        self.t: A = None
        self.z: A = None
        self.u: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

d = A("d")
m = B("m")
n = C("n")
g = D("g")
b = E("b")
l = F("l")
a = G("a")
f = H("f")
j = D("j")
i = E("i")

d.s = l
d.z = j
m.s = f
m.p = d
m.q = b
n.o = f
n.s = f
n.z = a
n.v = g
n.r = j
n.u = m
g.v = a
b.q = n
b.z = f
l.w = f
l.y = n
l.t = d
l.z = d
l.u = m
a.w = d
f.y = d
j.v = a
i.q = n
i.z = f
assert a.w.s.w.y.s.z.s.txt == "l"