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

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

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: F = None
        self.p: G = None
        self.y: E = None
        self.s: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: C = None
        self.o: F = None
        self.z: C = None
        self.p: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: F = None
        self.p: G = None
        self.y: E = None
        self.s: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: C = None
        self.o: F = None
        self.z: C = None
        self.p: A = None
        self.txt = txt

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

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