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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: D = None
        self.r: F = None
        self.p: F = None
        self.w: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: F = None
        self.x: D = None
        self.v: B = None
        self.txt = txt

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

c = A("c")
l = B("l")
a = C("a")
d = D("d")
m = E("m")
f = F("f")

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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: D = None
        self.r: F = None
        self.p: F = None
        self.w: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: F = None
        self.x: D = None
        self.v: B = None
        self.txt = txt

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

c = A("c")
l = B("l")
a = C("a")
d = D("d")
m = E("m")
f = F("f")

c.y = l
c.s = l
c.w = m
c.x = d
c.q = a
c.v = f
l.q = d
a.s = d
a.y = d
a.r = f
a.p = f
a.w = f
d.t = f
d.u = f
d.s = l
d.q = a
d.x = a
m.t = d
m.x = d
m.o = f
m.v = l
f.x = d
f.t = l
f.w = l
assert l.q.s.q.txt == "d"