class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: H = None
        self.r: I = None
        self.w: G = None
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: F = None
        self.v: E = None
        self.o: C = None
        self.r: I = None
        self.u: C = None
        self.y: I = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.r: C = None
        self.p: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: I = None
        self.w: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: F = None
        self.v: E = None
        self.o: C = None
        self.r: I = None
        self.u: C = None
        self.y: I = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.r: C = None
        self.p: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: I = None
        self.w: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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