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

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: E = None
        self.y: H = None
        self.r: G = None
        self.v: B = None
        self.w: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: B = None
        self.s: A = None
        self.o: I = None
        self.z: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

m = A("m")
i = B("i")
j = C("j")
e = D("e")
l = E("l")
d = F("d")
n = G("n")
f = H("f")
g = I("g")

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

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: E = None
        self.y: H = None
        self.r: G = None
        self.v: B = None
        self.w: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: B = None
        self.s: A = None
        self.o: I = None
        self.z: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

m = A("m")
i = B("i")
j = C("j")
e = D("e")
l = E("l")
d = F("d")
n = G("n")
f = H("f")
g = I("g")

m.q = l
m.x = l
m.t = l
m.p = e
m.r = e
m.s = f
m.v = n
m.o = j
m.y = d
i.r = g
j.r = f
j.z = n
j.t = i
e.q = i
e.v = i
e.t = l
e.y = f
e.r = n
e.w = g
l.w = d
l.z = d
l.p = d
l.y = e
d.t = j
d.z = j
d.r = i
d.s = m
d.o = g
n.w = l
n.s = j
n.q = i
n.r = i
f.w = d
g.t = i
g.x = i
g.q = j
g.u = j
g.s = d
g.o = f
g.r = f
g.p = l
g.w = n
assert f.w.r.r.txt == "g"