class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: E = None
        self.o: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: E = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: C = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: A = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: A = None
        self.q: B = None
        self.o: A = None
        self.txt = txt

m = A("m")
f = B("f")
j = C("j")
e = D("e")
n = E("n")
d = F("d")
a = G("a")
i = C("i")

m.u = n
m.x = n
m.o = a
f.o = e
j.u = i
j.y = f
e.s = j
e.z = n
e.x = a
n.u = i
n.o = j
n.p = e
d.u = a
d.r = a
d.v = m
a.s = m
a.y = m
a.o = m
a.q = f
i.u = j
i.y = f
assert d.v.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: E = None
        self.o: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: E = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: C = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: A = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: A = None
        self.q: B = None
        self.o: A = None
        self.txt = txt

m = A("m")
f = B("f")
j = C("j")
e = D("e")
n = E("n")
d = F("d")
a = G("a")
i = C("i")

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