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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

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

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

f = A("f")
i = B("i")
d = C("d")
a = D("a")
m = E("m")
b = F("b")
g = F("g")

f.q = m
i.z = d
d.y = g
d.t = g
d.p = b
d.w = f
a.s = d
m.q = g
m.t = d
m.w = i
b.v = a
b.o = i
b.y = i
b.z = m
b.p = d
g.v = a
g.o = i
g.y = i
g.z = m
g.p = d
assert i.z.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

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

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

f = A("f")
i = B("i")
d = C("d")
a = D("a")
m = E("m")
b = F("b")
g = F("g")

f.q = m
i.z = d
d.y = g
d.t = g
d.p = b
d.w = f
a.s = d
m.q = g
m.t = d
m.w = i
b.v = a
b.o = i
b.y = i
b.z = m
b.p = d
g.v = a
g.o = i
g.y = i
g.z = m
g.p = d
assert i.z.y.v.txt == "a"