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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

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