class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: B = None
        self.w: B = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: D = None
        self.z: A = None
        self.w: C = None
        self.r: D = None
        self.q: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: D = None
        self.z: A = None
        self.w: C = None
        self.r: D = None
        self.q: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

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