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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: D = None
        self.txt = txt

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

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

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

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

e = A("e")
f = B("f")
j = C("j")
n = D("n")
l = E("l")
h = F("h")
i = G("i")
b = E("b")
m = D("m")
d = A("d")

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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: D = None
        self.txt = txt

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

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

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

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

e = A("e")
f = B("f")
j = C("j")
n = D("n")
l = E("l")
h = F("h")
i = G("i")
b = E("b")
m = D("m")
d = A("d")

e.s = d
e.w = d
e.y = n
f.q = j
f.s = e
j.u = e
j.p = n
n.v = l
n.x = i
n.w = b
l.t = m
l.u = m
l.w = f
h.v = l
h.s = f
h.z = i
i.z = f
b.t = n
b.u = n
b.w = f
m.v = b
m.x = i
m.w = l
d.s = e
d.w = e
d.y = n
assert h.s.s.s.s.txt == "e"