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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: C = None
        self.x: E = None
        self.o: D = None
        self.z: A = None
        self.t: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: C = None
        self.x: E = None
        self.o: D = None
        self.z: A = None
        self.t: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: F = None
        self.txt = txt

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

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

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