class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: F = None
        self.z: I = None
        self.u: D = None
        self.o: H = None
        self.r: A = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: G = None
        self.z: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: B = None
        self.y: B = None
        self.x: G = None
        self.u: D = None
        self.z: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: F = None
        self.z: I = None
        self.u: D = None
        self.o: H = None
        self.r: A = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: G = None
        self.z: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: B = None
        self.y: B = None
        self.x: G = None
        self.u: D = None
        self.z: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: D = None
        self.txt = txt

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

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