class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: G = None
        self.x: I = None
        self.o: D = None
        self.t: C = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: H = None
        self.r: D = None
        self.q: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: H = None
        self.u: B = None
        self.o: E = None
        self.q: A = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: I = None
        self.txt = txt

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

f = A("f")
h = B("h")
j = C("j")
g = D("g")
n = E("n")
i = F("i")
e = G("e")
a = H("a")
m = I("m")
l = D("l")

f.q = h
f.r = e
f.x = m
f.o = l
f.t = j
f.y = g
h.w = e
h.x = a
h.r = g
h.q = m
j.s = i
j.y = f
g.q = i
n.y = f
i.w = m
i.u = e
e.r = i
e.w = a
e.u = h
e.s = h
e.o = n
e.q = f
a.t = i
a.x = m
m.s = g
l.q = i
assert h.w.o.y.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: G = None
        self.x: I = None
        self.o: D = None
        self.t: C = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: H = None
        self.r: D = None
        self.q: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: H = None
        self.u: B = None
        self.o: E = None
        self.q: A = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: I = None
        self.txt = txt

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

f = A("f")
h = B("h")
j = C("j")
g = D("g")
n = E("n")
i = F("i")
e = G("e")
a = H("a")
m = I("m")
l = D("l")

f.q = h
f.r = e
f.x = m
f.o = l
f.t = j
f.y = g
h.w = e
h.x = a
h.r = g
h.q = m
j.s = i
j.y = f
g.q = i
n.y = f
i.w = m
i.u = e
e.r = i
e.w = a
e.u = h
e.s = h
e.o = n
e.q = f
a.t = i
a.x = m
m.s = g
l.q = i
assert h.w.o.y.t.s.txt == "i"