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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: D = None
        self.y: D = None
        self.u: B = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: D = None
        self.p: B = None
        self.u: E = None
        self.s: D = None
        self.x: F = None
        self.txt = txt

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

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

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

c.y = f
c.t = b
c.p = d
c.w = d
c.x = l
f.q = j
f.x = e
f.p = e
l.r = c
l.p = e
l.y = e
l.u = f
l.q = f
i.r = e
i.q = e
i.s = e
i.p = f
i.u = d
i.x = j
d.q = b
d.o = f
d.s = f
d.x = f
j.r = f
j.x = f
j.o = b
j.s = c
e.r = i
e.q = i
e.s = i
e.p = f
e.u = d
e.x = j
h.r = c
h.p = e
h.y = e
h.u = f
h.q = f
b.y = f
b.t = c
b.p = d
b.w = d
b.x = l
assert f.q.o.t.y.q.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: A = None
        self.p: E = None
        self.x: C = None
        self.w: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: D = None
        self.y: D = None
        self.u: B = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: D = None
        self.p: B = None
        self.u: E = None
        self.s: D = None
        self.x: F = None
        self.txt = txt

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

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

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

c.y = f
c.t = b
c.p = d
c.w = d
c.x = l
f.q = j
f.x = e
f.p = e
l.r = c
l.p = e
l.y = e
l.u = f
l.q = f
i.r = e
i.q = e
i.s = e
i.p = f
i.u = d
i.x = j
d.q = b
d.o = f
d.s = f
d.x = f
j.r = f
j.x = f
j.o = b
j.s = c
e.r = i
e.q = i
e.s = i
e.p = f
e.u = d
e.x = j
h.r = c
h.p = e
h.y = e
h.u = f
h.q = f
b.y = f
b.t = c
b.p = d
b.w = d
b.x = l
assert f.q.o.t.y.q.s.txt == "c"