class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: E = None
        self.p: D = None
        self.u: D = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

j = A("j")
g = B("g")
f = C("f")
i = D("i")
e = E("e")
a = F("a")
m = C("m")

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

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

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

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

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

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

j = A("j")
g = B("g")
f = C("f")
i = D("i")
e = E("e")
a = F("a")
m = C("m")

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