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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: D = None
        self.y: C = None
        self.z: C = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: F = None
        self.u: F = None
        self.r: E = None
        self.p: D = None
        self.s: D = None
        self.txt = txt

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

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

b.s = i
b.x = i
g.y = j
j.u = i
j.q = i
j.y = k
j.z = k
j.p = n
i.z = a
a.y = g
a.s = h
a.q = n
n.x = h
n.q = f
n.u = f
n.r = a
n.p = i
n.s = i
h.w = i
h.v = i
f.x = h
f.q = n
f.u = n
f.r = a
f.p = i
f.s = i
k.u = i
k.q = i
k.y = j
k.z = j
k.p = f
assert g.y.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: D = None
        self.y: C = None
        self.z: C = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: F = None
        self.u: F = None
        self.r: E = None
        self.p: D = None
        self.s: D = None
        self.txt = txt

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

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

b.s = i
b.x = i
g.y = j
j.u = i
j.q = i
j.y = k
j.z = k
j.p = n
i.z = a
a.y = g
a.s = h
a.q = n
n.x = h
n.q = f
n.u = f
n.r = a
n.p = i
n.s = i
h.w = i
h.v = i
f.x = h
f.q = n
f.u = n
f.r = a
f.p = i
f.s = i
k.u = i
k.q = i
k.y = j
k.z = j
k.p = f
assert g.y.p.q.txt == "f"