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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: A = None
        self.t: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: G = None
        self.u: F = None
        self.s: D = None
        self.txt = txt

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

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

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

f.o = i
f.q = j
f.v = a
f.r = c
f.z = h
c.q = j
c.z = f
c.t = f
a.r = k
a.q = k
a.v = c
j.y = c
h.r = j
h.s = j
h.t = i
h.u = k
k.q = f
k.o = c
i.s = k
i.q = k
assert c.q.y.z.q.y.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: D = None
        self.v: C = None
        self.r: B = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: A = None
        self.t: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: G = None
        self.u: F = None
        self.s: D = None
        self.txt = txt

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

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

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

f.o = i
f.q = j
f.v = a
f.r = c
f.z = h
c.q = j
c.z = f
c.t = f
a.r = k
a.q = k
a.v = c
j.y = c
h.r = j
h.s = j
h.t = i
h.u = k
k.q = f
k.o = c
i.s = k
i.q = k
assert c.q.y.z.q.y.t.o.txt == "i"