class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: F = None
        self.v: B = None
        self.s: F = None
        self.p: A = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: A = None
        self.w: 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.t: C = None
        self.z: C = None
        self.o: G = None
        self.s: G = None
        self.r: A = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: D = None
        self.v: B = None
        self.txt = txt

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

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

m = A("m")
a = B("a")
f = C("f")
i = D("i")
b = E("b")
c = F("c")
h = G("h")
n = A("n")
d = B("d")

m.y = d
m.u = c
m.s = c
m.v = a
m.p = n
m.o = b
a.x = h
a.y = n
a.w = i
f.y = m
i.t = f
i.z = f
i.o = h
i.s = h
i.r = m
i.x = n
b.r = f
b.w = i
b.v = d
c.p = i
h.r = a
n.y = d
n.u = c
n.s = c
n.v = a
n.p = m
n.o = b
d.x = h
d.y = n
d.w = i
assert m.o.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: F = None
        self.v: B = None
        self.s: F = None
        self.p: A = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: A = None
        self.w: 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.t: C = None
        self.z: C = None
        self.o: G = None
        self.s: G = None
        self.r: A = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: D = None
        self.v: B = None
        self.txt = txt

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

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

m = A("m")
a = B("a")
f = C("f")
i = D("i")
b = E("b")
c = F("c")
h = G("h")
n = A("n")
d = B("d")

m.y = d
m.u = c
m.s = c
m.v = a
m.p = n
m.o = b
a.x = h
a.y = n
a.w = i
f.y = m
i.t = f
i.z = f
i.o = h
i.s = h
i.r = m
i.x = n
b.r = f
b.w = i
b.v = d
c.p = i
h.r = a
n.y = d
n.u = c
n.s = c
n.v = a
n.p = m
n.o = b
d.x = h
d.y = n
d.w = i
assert m.o.r.y.txt == "m"