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

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: D = None
        self.w: F = None
        self.t: B = None
        self.txt = txt

i = A("i")
m = B("m")
h = C("h")
e = D("e")
d = E("d")
j = F("j")
l = G("l")
a = A("a")
c = E("c")

i.r = a
i.p = h
i.v = m
i.x = j
m.o = j
m.t = j
h.y = c
h.q = m
e.y = a
e.v = a
d.o = a
j.u = h
j.t = e
j.w = i
l.s = e
l.q = e
l.w = j
l.t = m
a.r = i
a.p = h
a.v = m
a.x = j
c.o = i
assert e.y.v.t.u.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: C = None
        self.v: B = None
        self.x: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: D = None
        self.w: F = None
        self.t: B = None
        self.txt = txt

i = A("i")
m = B("m")
h = C("h")
e = D("e")
d = E("d")
j = F("j")
l = G("l")
a = A("a")
c = E("c")

i.r = a
i.p = h
i.v = m
i.x = j
m.o = j
m.t = j
h.y = c
h.q = m
e.y = a
e.v = a
d.o = a
j.u = h
j.t = e
j.w = i
l.s = e
l.q = e
l.w = j
l.t = m
a.r = i
a.p = h
a.v = m
a.x = j
c.o = i
assert e.y.v.t.u.y.o.txt == "i"