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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: G = None
        self.t: B = None
        self.y: G = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: F = None
        self.t: G = None
        self.w: I = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.t: D = None
        self.y: H = None
        self.u: B = None
        self.x: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: F = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: G = None
        self.t: B = None
        self.y: G = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: F = None
        self.t: G = None
        self.w: I = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.t: D = None
        self.y: H = None
        self.u: B = None
        self.x: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: F = None
        self.z: F = None
        self.txt = txt

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

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

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

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