class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: G = None
        self.s: I = None
        self.z: D = None
        self.y: D = None
        self.p: I = None
        self.q: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: I = None
        self.x: E = None
        self.p: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: G = None
        self.s: G = None
        self.o: H = None
        self.p: D = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: A = None
        self.y: H = None
        self.p: H = None
        self.s: D = None
        self.q: D = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: D = None
        self.u: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: I = None
        self.x: E = None
        self.p: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: G = None
        self.s: G = None
        self.o: H = None
        self.p: D = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: A = None
        self.y: H = None
        self.p: H = None
        self.s: D = None
        self.q: D = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: D = None
        self.u: D = None
        self.txt = txt

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

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