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

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: G = None
        self.o: C = None
        self.s: E = None
        self.w: A = None
        self.v: A = None
        self.y: B = None
        self.txt = txt

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

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

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

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

c.u = k
c.z = i
g.o = f
i.v = a
i.w = c
a.t = i
a.o = i
a.z = d
a.s = f
a.w = c
a.v = c
a.y = g
f.w = g
f.r = g
f.p = k
f.x = i
f.y = c
f.v = c
k.z = d
k.r = a
k.t = f
d.x = c
d.o = g
d.v = f
assert d.x.z.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: G = None
        self.o: C = None
        self.s: E = None
        self.w: A = None
        self.v: A = None
        self.y: B = None
        self.txt = txt

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

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

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

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

c.u = k
c.z = i
g.o = f
i.v = a
i.w = c
a.t = i
a.o = i
a.z = d
a.s = f
a.w = c
a.v = c
a.y = g
f.w = g
f.r = g
f.p = k
f.x = i
f.y = c
f.v = c
k.z = d
k.r = a
k.t = f
d.x = c
d.o = g
d.v = f
assert d.x.z.v.o.txt == "i"