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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: F = None
        self.x: G = None
        self.t: E = None
        self.z: A = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: G = None
        self.y: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: F = None
        self.r: F = None
        self.x: A = None
        self.w: B = None
        self.txt = txt

b = A("b")
e = B("e")
g = C("g")
l = D("l")
n = E("n")
d = F("d")
k = G("k")
j = E("j")
h = C("h")

b.s = h
e.o = n
g.w = d
g.t = k
g.s = e
l.y = k
l.x = k
l.u = d
l.t = j
l.q = j
l.z = b
n.t = d
n.x = k
n.y = k
d.q = j
d.p = b
k.t = n
k.q = d
k.r = d
k.x = b
k.w = e
j.t = d
j.x = k
j.y = k
h.w = d
h.t = k
h.s = e
assert j.y.x.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: F = None
        self.x: G = None
        self.t: E = None
        self.z: A = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: G = None
        self.y: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: F = None
        self.r: F = None
        self.x: A = None
        self.w: B = None
        self.txt = txt

b = A("b")
e = B("e")
g = C("g")
l = D("l")
n = E("n")
d = F("d")
k = G("k")
j = E("j")
h = C("h")

b.s = h
e.o = n
g.w = d
g.t = k
g.s = e
l.y = k
l.x = k
l.u = d
l.t = j
l.q = j
l.z = b
n.t = d
n.x = k
n.y = k
d.q = j
d.p = b
k.t = n
k.q = d
k.r = d
k.x = b
k.w = e
j.t = d
j.x = k
j.y = k
h.w = d
h.t = k
h.s = e
assert j.y.x.s.w.txt == "d"