class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: F = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

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

g = A("g")
f = B("f")
m = C("m")
c = D("c")
j = E("j")
h = F("h")
l = B("l")
e = D("e")

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: F = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

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

g = A("g")
f = B("f")
m = C("m")
c = D("c")
j = E("j")
h = F("h")
l = B("l")
e = D("e")

g.y = m
g.r = m
f.o = g
f.z = h
f.u = c
m.u = j
c.x = m
c.u = h
c.p = h
c.w = g
c.s = g
j.w = f
j.y = e
j.q = g
j.t = h
h.u = g
h.q = m
h.t = m
h.o = j
h.y = l
l.o = g
l.z = h
l.u = c
e.x = m
e.u = h
e.p = h
e.w = g
e.s = g
assert f.o.r.u.y.x.txt == "m"