class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: F = None
        self.v: F = None
        self.r: D = None
        self.w: E = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: C = None
        self.s: B = None
        self.u: D = None
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: D = None
        self.u: A = None
        self.y: A = None
        self.x: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: G = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: A = None
        self.t: G = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: F = None
        self.z: A = None
        self.t: B = None
        self.q: F = None
        self.v: F = None
        self.r: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: C = None
        self.s: B = None
        self.u: D = None
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: D = None
        self.u: A = None
        self.y: A = None
        self.x: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: G = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: A = None
        self.t: G = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: F = None
        self.z: A = None
        self.t: B = None
        self.q: F = None
        self.v: F = None
        self.r: B = None
        self.txt = txt

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

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