class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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