class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: E = None
        self.y: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: A = None
        self.x: D = None
        self.u: F = None
        self.txt = txt

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

h = A("h")
m = B("m")
g = C("g")
a = D("a")
e = E("e")
i = F("i")
n = F("n")
c = C("c")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: A = None
        self.x: D = None
        self.u: F = None
        self.txt = txt

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

h = A("h")
m = B("m")
g = C("g")
a = D("a")
e = E("e")
i = F("i")
n = F("n")
c = C("c")

h.s = e
h.x = e
h.y = n
m.r = a
m.y = a
m.p = n
m.u = n
m.t = i
m.v = h
g.r = h
g.w = e
g.z = m
a.o = e
a.v = m
a.z = i
e.q = n
e.v = h
e.x = a
e.u = i
i.o = c
n.o = c
c.r = h
c.w = e
c.z = m
assert e.q.o.r.x.txt == "e"