class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: A = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

m = A("m")
e = B("e")
k = C("k")
i = D("i")
g = E("g")
d = F("d")
f = G("f")
h = A("h")
c = E("c")

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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: A = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

m = A("m")
e = B("e")
k = C("k")
i = D("i")
g = E("g")
d = F("d")
f = G("f")
h = A("h")
c = E("c")

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