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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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