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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: B = None
        self.w: A = None
        self.r: F = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: F = None
        self.o: C = None
        self.u: A = None
        self.txt = txt

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

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

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

b.w = h
i.u = b
i.s = b
i.x = j
n.u = h
n.o = h
n.p = b
n.s = b
n.t = i
h.o = a
h.z = i
h.w = b
h.r = l
h.p = n
a.z = n
a.o = n
a.r = l
a.u = b
l.z = j
j.r = n
j.x = n
j.o = h
j.t = a
j.y = l
j.s = i
assert l.z.y.z.t.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: B = None
        self.w: A = None
        self.r: F = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: F = None
        self.o: C = None
        self.u: A = None
        self.txt = txt

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

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

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

b.w = h
i.u = b
i.s = b
i.x = j
n.u = h
n.o = h
n.p = b
n.s = b
n.t = i
h.o = a
h.z = i
h.w = b
h.r = l
h.p = n
a.z = n
a.o = n
a.r = l
a.u = b
l.z = j
j.r = n
j.x = n
j.o = h
j.t = a
j.y = l
j.s = i
assert l.z.y.z.t.o.s.txt == "b"