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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: B = None
        self.v: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: A = None
        self.txt = txt

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

h = A("h")
e = B("e")
l = C("l")
j = D("j")
f = E("f")
a = F("a")
c = G("c")
d = G("d")
b = F("b")

h.s = c
h.r = d
h.w = d
h.v = e
e.z = h
l.t = h
l.u = a
j.u = e
j.s = e
j.v = e
f.q = d
f.w = e
f.u = j
f.r = j
a.v = f
a.y = h
c.r = e
c.z = f
d.r = e
d.z = f
b.v = f
b.y = h
assert c.z.w.z.s.r.z.s.z.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: G = None
        self.v: B = None
        self.w: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: B = None
        self.v: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: A = None
        self.txt = txt

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

h = A("h")
e = B("e")
l = C("l")
j = D("j")
f = E("f")
a = F("a")
c = G("c")
d = G("d")
b = F("b")

h.s = c
h.r = d
h.w = d
h.v = e
e.z = h
l.t = h
l.u = a
j.u = e
j.s = e
j.v = e
f.q = d
f.w = e
f.u = j
f.r = j
a.v = f
a.y = h
c.r = e
c.z = f
d.r = e
d.z = f
b.v = f
b.y = h
assert c.z.w.z.s.r.z.s.z.w.txt == "e"