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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: G = None
        self.q: E = None
        self.s: E = None
        self.y: E = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: B = None
        self.p: E = None
        self.o: B = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: G = None
        self.q: E = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: G = None
        self.q: E = None
        self.s: E = None
        self.y: E = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: B = None
        self.p: E = None
        self.o: B = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: G = None
        self.q: E = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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