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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: E = None
        self.r: H = None
        self.y: C = None
        self.x: C = None
        self.u: I = None
        self.o: E = None
        self.z: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: F = None
        self.w: B = None
        self.y: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: C = None
        self.p: A = None
        self.y: C = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: E = None
        self.t: E = None
        self.txt = txt

f = A("f")
i = B("i")
g = C("g")
k = D("k")
d = E("d")
c = F("c")
b = G("b")
l = H("l")
a = I("a")
e = D("e")

f.q = e
i.q = g
i.y = g
i.x = g
i.w = d
i.o = d
i.z = d
i.r = l
i.u = a
g.p = k
k.s = b
k.r = c
k.y = c
k.w = i
d.x = f
c.v = g
c.s = k
c.t = b
b.w = l
b.z = g
b.y = g
b.p = f
b.v = a
l.r = g
a.v = g
a.p = d
a.t = d
e.s = b
e.r = c
e.y = c
e.w = i
assert f.q.s.w.r.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: E = None
        self.r: H = None
        self.y: C = None
        self.x: C = None
        self.u: I = None
        self.o: E = None
        self.z: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: F = None
        self.w: B = None
        self.y: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: C = None
        self.p: A = None
        self.y: C = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: E = None
        self.t: E = None
        self.txt = txt

f = A("f")
i = B("i")
g = C("g")
k = D("k")
d = E("d")
c = F("c")
b = G("b")
l = H("l")
a = I("a")
e = D("e")

f.q = e
i.q = g
i.y = g
i.x = g
i.w = d
i.o = d
i.z = d
i.r = l
i.u = a
g.p = k
k.s = b
k.r = c
k.y = c
k.w = i
d.x = f
c.v = g
c.s = k
c.t = b
b.w = l
b.z = g
b.y = g
b.p = f
b.v = a
l.r = g
a.v = g
a.p = d
a.t = d
e.s = b
e.r = c
e.y = c
e.w = i
assert f.q.s.w.r.p.txt == "k"