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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: A = None
        self.r: C = None
        self.z: A = None
        self.s: D = None
        self.p: D = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

i.s = l
b.x = l
b.s = l
b.p = l
b.w = i
b.z = i
b.r = e
b.u = e
e.v = l
l.x = a
l.u = i
l.v = d
d.u = a
d.o = b
d.v = e
d.s = l
d.r = h
a.q = b
a.x = d
a.v = d
h.s = e
assert b.x.u.s.u.s.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: A = None
        self.r: C = None
        self.z: A = None
        self.s: D = None
        self.p: D = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

i.s = l
b.x = l
b.s = l
b.p = l
b.w = i
b.z = i
b.r = e
b.u = e
e.v = l
l.x = a
l.u = i
l.v = d
d.u = a
d.o = b
d.v = e
d.s = l
d.r = h
a.q = b
a.x = d
a.v = d
h.s = e
assert b.x.u.s.u.s.v.s.txt == "l"