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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: E = None
        self.z: E = None
        self.w: C = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: E = None
        self.s: E = None
        self.txt = txt

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

f.y = g
f.v = m
f.w = j
f.u = b
b.r = a
b.q = j
b.p = j
b.z = d
b.x = d
d.v = i
d.o = i
d.u = a
j.x = g
j.v = a
a.y = j
a.r = h
a.z = h
a.w = m
a.x = i
i.r = d
i.q = a
i.s = h
g.r = d
g.q = a
g.s = h
h.y = j
h.r = a
h.z = a
h.w = d
h.x = i
m.v = g
m.o = g
m.u = a
assert i.s.x.s.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: C = None
        self.w: D = None
        self.u: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: E = None
        self.z: E = None
        self.w: C = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: E = None
        self.s: E = None
        self.txt = txt

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

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