class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: C = None
        self.u: F = None
        self.o: H = None
        self.p: E = None
        self.z: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: G = None
        self.p: F = None
        self.t: H = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: I = None
        self.s: B = None
        self.p: A = None
        self.y: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: F = None
        self.r: I = None
        self.t: B = None
        self.s: C = None
        self.v: F = None
        self.y: D = None
        self.q: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: G = None
        self.p: F = None
        self.t: H = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: I = None
        self.s: B = None
        self.p: A = None
        self.y: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: F = None
        self.r: I = None
        self.t: B = None
        self.s: C = None
        self.v: F = None
        self.y: D = None
        self.q: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: A = None
        self.txt = txt

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

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